package com.atguigu.gmall.order.service;

import com.atguigu.gmall.model.order.OrderInfo;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.stereotype.Service;

/**
 * @author sunjipu
 * @create 2020-04-18 16:06
 */
@Service
public interface OrderService extends IService<OrderInfo> {

    /**
     * 保存订单
     * @param orderInfo
     * @return
     */
    Long saveOrderInfo(OrderInfo orderInfo);

    String getTradeNo(String userId);

    boolean checkTradeCode(String userId, String tradeNo);

    void deleteTradeNo(String userId);

    boolean checkStock(Long skuId, Integer skuNum);

    //取消丁丹
    public void cancelOrder(String orderId);

    /**
     * 根据订单Id 查询订单信息
     * @param orderId
     * @return
     */
    OrderInfo getOrderInfo(Long orderId);

    void updateOrderStatus(OrderInfo orderInfo);
}